.class public Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;
.super Ljava/lang/Object;
.source "NavigationLines.java"


# instance fields
.field private crds:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

.field private ctx:Landroid/content/Context;

.field private generator:Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

.field private lastNavigation:Lcom/google/android/gms/maps/model/Polyline;

.field private lastindx:I

.field private navigation:Lcom/google/android/gms/maps/model/Polyline;

.field private techWidth:D


# direct methods
.method public constructor <init>(Landroid/content/Context;D)V
    .locals 1

    .line 36
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 31
    new-instance v0, Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    invoke-direct {v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->crds:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    const/4 v0, -0x1

    .line 37
    iput v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastindx:I

    .line 38
    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->ctx:Landroid/content/Context;

    .line 39
    iput-wide p2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->techWidth:D

    return-void
.end method


# virtual methods
.method public getNavigationLineAsJTSLineSegment(Llt/noframe/gpsfarmguide/sprayer/CCalcs;)Lcom/vividsolutions/jts/geom/LineSegment;
    .locals 4

    .line 126
    new-instance v0, Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p1, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    iget-object v2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v2}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v2

    const/4 v3, 0x1

    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p1, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    invoke-direct {v0, v1, p1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    return-object v0
.end method

.method public getNavigationLinesAsLatLng()[Lcom/google/android/gms/maps/model/LatLng;
    .locals 3

    const/4 v0, 0x2

    .line 131
    new-array v0, v0, [Lcom/google/android/gms/maps/model/LatLng;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    aput-object v1, v0, v2

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    const/4 v2, 0x1

    invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    aput-object v1, v0, v2

    return-object v0
.end method

.method public isNavigationSelected()Z
    .locals 1

    .line 120
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method public navigate(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Llt/noframe/gpsfarmguide/sprayer/CCalcs;)V
    .locals 17

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object/from16 v3, p3

    .line 137
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v4

    invoke-virtual {v4}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v4

    const/4 v5, 0x0

    if-eqz v4, :cond_d

    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v4

    invoke-virtual {v4}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/List;->size()I

    move-result v4

    const/4 v8, 0x1

    if-ge v4, v8, :cond_0

    goto/16 :goto_3

    .line 142
    :cond_0
    invoke-virtual {v0, v1, v3}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->selectNearestLine(Lcom/google/android/gms/maps/model/LatLng;Llt/noframe/gpsfarmguide/sprayer/CCalcs;)V

    .line 144
    invoke-virtual {v0, v3}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->getNavigationLineAsJTSLineSegment(Llt/noframe/gpsfarmguide/sprayer/CCalcs;)Lcom/vividsolutions/jts/geom/LineSegment;

    move-result-object v4

    .line 145
    invoke-virtual {v3, v2, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->lineSegmentBearing(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v9

    .line 146
    invoke-virtual {v3, v2, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v11

    .line 148
    invoke-virtual {v3, v4}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->lineSegmentBearing(Lcom/vividsolutions/jts/geom/LineSegment;)D

    move-result-wide v13

    .line 149
    invoke-virtual {v3, v13, v14, v9, v10}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->getBearingDifference(DD)D

    move-result-wide v9

    invoke-static {v9, v10}, Ljava/lang/Math;->abs(D)D

    move-result-wide v9

    .line 153
    invoke-virtual/range {p0 .. p0}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->getNavigationLinesAsLatLng()[Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v2

    .line 155
    aget-object v13, v2, v5

    aget-object v2, v2, v8

    invoke-virtual {v3, v13, v2, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetweenLineAndPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v13

    .line 157
    invoke-virtual {v3, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    .line 159
    iget-wide v2, v0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->techWidth:D

    const-wide/high16 v15, 0x3ff8000000000000L    # 1.5

    mul-double v2, v2, v15

    cmpl-double v15, v13, v2

    if-lez v15, :cond_1

    .line 160
    invoke-virtual {v0, v13, v14, v5}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    return-void

    :cond_1
    const-wide v2, 0x3fb999999999999aL    # 0.1

    cmpg-double v15, v11, v2

    if-gez v15, :cond_2

    return-void

    :cond_2
    cmpg-double v12, v13, v2

    if-gez v12, :cond_7

    const-wide v2, 0x4065400000000000L    # 170.0

    cmpl-double v12, v9, v2

    if-lez v12, :cond_3

    const-wide v2, 0x4067c00000000000L    # 190.0

    cmpg-double v12, v9, v2

    if-ltz v12, :cond_6

    :cond_3
    const-wide v2, 0x4075e00000000000L    # 350.0

    cmpl-double v12, v9, v2

    if-gtz v12, :cond_6

    const-wide/high16 v2, 0x4024000000000000L    # 10.0

    cmpg-double v12, v9, v2

    if-gez v12, :cond_4

    goto :goto_1

    .line 175
    :cond_4
    iget-object v2, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v9, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-object v3, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v4, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v9, v4

    iget-wide v11, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v6, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v11, v6

    mul-double v9, v9, v11

    iget-wide v2, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v2, v6

    iget-wide v6, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v6, v4

    mul-double v2, v2, v6

    sub-double/2addr v9, v2

    const-wide/16 v1, 0x0

    cmpl-double v3, v9, v1

    if-lez v3, :cond_5

    .line 176
    invoke-virtual {v0, v13, v14, v8}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    goto :goto_0

    :cond_5
    const/4 v1, 0x2

    .line 177
    invoke-virtual {v0, v13, v14, v1}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    :goto_0
    return-void

    .line 171
    :cond_6
    :goto_1
    invoke-virtual {v0, v13, v14, v5}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    return-void

    :cond_7
    const-wide v2, 0x4070e00000000000L    # 270.0

    const-wide v5, 0x4056800000000000L    # 90.0

    cmpl-double v7, v9, v5

    if-lez v7, :cond_9

    cmpg-double v7, v9, v2

    if-gez v7, :cond_9

    .line 182
    iget-object v2, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v5, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-object v3, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v9, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v5, v9

    iget-wide v11, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v3, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v11, v3

    mul-double v5, v5, v11

    iget-wide v11, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v11, v3

    iget-wide v1, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, v9

    mul-double v11, v11, v1

    sub-double/2addr v5, v11

    const-wide/16 v1, 0x0

    cmpl-double v3, v5, v1

    if-lez v3, :cond_8

    .line 183
    invoke-virtual {v0, v13, v14, v8}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    goto :goto_2

    :cond_8
    const/4 v1, 0x2

    .line 184
    invoke-virtual {v0, v13, v14, v1}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    goto :goto_2

    :cond_9
    cmpl-double v7, v9, v2

    if-gtz v7, :cond_a

    cmpg-double v2, v9, v5

    if-gez v2, :cond_c

    .line 187
    :cond_a
    iget-object v2, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v5, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-object v3, v4, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v9, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v5, v9

    iget-wide v11, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v3, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v11, v3

    mul-double v5, v5, v11

    iget-wide v11, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v11, v3

    iget-wide v1, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, v9

    mul-double v11, v11, v1

    sub-double/2addr v5, v11

    const-wide/16 v1, 0x0

    cmpl-double v3, v5, v1

    if-lez v3, :cond_b

    const/4 v1, 0x2

    .line 188
    invoke-virtual {v0, v13, v14, v1}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    goto :goto_2

    .line 189
    :cond_b
    invoke-virtual {v0, v13, v14, v8}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    :cond_c
    :goto_2
    return-void

    :cond_d
    :goto_3
    const-wide/16 v1, 0x0

    .line 138
    invoke-virtual {v0, v1, v2, v5}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->updateNavigationGui(DI)V

    return-void
.end method

.method public removeNaviLines()V
    .locals 2

    .line 113
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 114
    :goto_0
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 115
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->remove()V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method

.method public selectNearestLine(Lcom/google/android/gms/maps/model/LatLng;Llt/noframe/gpsfarmguide/sprayer/CCalcs;)V
    .locals 7

    .line 95
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object v3

    iget v4, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastindx:I

    iget-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->techWidth:D

    const-wide/high16 v5, 0x4000000000000000L    # 2.0

    div-double v5, v0, v5

    move-object v1, p2

    move-object v2, p1

    invoke-virtual/range {v1 .. v6}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->getNearestLineIndexGoogle(Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;ID)I

    move-result p1

    .line 96
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p2

    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/Data;->getNavigation()Ljava/util/List;

    move-result-object p2

    invoke-interface {p2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Lcom/google/android/gms/maps/model/Polyline;

    iput-object p2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    .line 98
    iget p2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastindx:I

    if-eq p1, p2, :cond_1

    .line 100
    iget-object p2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastNavigation:Lcom/google/android/gms/maps/model/Polyline;

    if-eqz p2, :cond_0

    .line 101
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->ctx:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f060106

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    invoke-virtual {p2, v0}, Lcom/google/android/gms/maps/model/Polyline;->setColor(I)V

    .line 104
    :cond_0
    iget-object p2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->ctx:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f060107

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    invoke-virtual {p2, v0}, Lcom/google/android/gms/maps/model/Polyline;->setColor(I)V

    .line 105
    iput p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastindx:I

    .line 106
    iget-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->navigation:Lcom/google/android/gms/maps/model/Polyline;

    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->lastNavigation:Lcom/google/android/gms/maps/model/Polyline;

    :cond_1
    return-void
.end method

.method public setNavigationAsync(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;Landroid/os/Handler;Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator$OnShtrichLineSetListener;)V
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;",
            "Landroid/os/Handler;",
            "Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator$OnShtrichLineSetListener;",
            ")V"
        }
    .end annotation

    .line 45
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->generator:Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/utils/CancelableThread;->cancel()V

    .line 46
    :cond_0
    new-instance v0, Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

    iget-wide v5, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->techWidth:D

    move-object v1, v0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v7, p0

    move-object v8, p4

    invoke-direct/range {v1 .. v8}, Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;-><init>(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;DLlt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;Landroid/os/Handler;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->generator:Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

    if-eqz p5, :cond_1

    .line 48
    iget-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->generator:Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

    invoke-virtual {p1, p5}, Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;->addOnShtrichLineSetListeners(Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator$OnShtrichLineSetListener;)V

    .line 49
    :cond_1
    iget-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->generator:Llt/noframe/gpsfarmguide/sprayer/navigation/AsyncNavigationLinesGenerator;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/utils/CancelableThread;->start()V

    return-void
.end method

.method public setNavigationLines(Ljava/util/Map;)V
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;)V"
        }
    .end annotation

    .line 75
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->removeNaviLines()V

    .line 76
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 78
    invoke-interface {p1}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    .line 80
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v3

    new-instance v4, Lcom/google/android/gms/maps/model/PolylineOptions;

    invoke-direct {v4}, Lcom/google/android/gms/maps/model/PolylineOptions;-><init>()V

    .line 82
    invoke-virtual {v4, v2}, Lcom/google/android/gms/maps/model/PolylineOptions;->add(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/PolylineOptions;

    .line 83
    invoke-interface {p1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {v4, v2}, Lcom/google/android/gms/maps/model/PolylineOptions;->add(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/PolylineOptions;

    iget-object v2, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->ctx:Landroid/content/Context;

    .line 84
    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v5, 0x7f060106

    invoke-virtual {v2, v5}, Landroid/content/res/Resources;->getColor(I)I

    move-result v2

    invoke-virtual {v4, v2}, Lcom/google/android/gms/maps/model/PolylineOptions;->color(I)Lcom/google/android/gms/maps/model/PolylineOptions;

    const/high16 v2, 0x40000000    # 2.0f

    .line 85
    invoke-virtual {v4, v2}, Lcom/google/android/gms/maps/model/PolylineOptions;->width(F)Lcom/google/android/gms/maps/model/PolylineOptions;

    .line 80
    invoke-virtual {v3, v4}, Lcom/google/android/gms/maps/GoogleMap;->addPolyline(Lcom/google/android/gms/maps/model/PolylineOptions;)Lcom/google/android/gms/maps/model/Polyline;

    move-result-object v2

    .line 79
    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 88
    :cond_0
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1, v0}, Llt/noframe/gpsfarmguide/Data;->setNavigation(Ljava/util/List;)V

    return-void
.end method

.method public updateNavigationGui(DI)V
    .locals 7

    .line 195
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getNavigationTop()Llt/noframe/gpsfarmguide/widgets/TopNavigationBar/TopRunningNavigationBar;

    move-result-object v1

    if-eqz v1, :cond_0

    .line 198
    iget-wide v5, p0, Llt/noframe/gpsfarmguide/sprayer/navigation/NavigationLines;->techWidth:D

    move-wide v2, p1

    move v4, p3

    invoke-virtual/range {v1 .. v6}, Llt/noframe/gpsfarmguide/widgets/TopNavigationBar/TopRunningNavigationBar;->setNavigationView(DID)V

    goto :goto_0

    :cond_0
    const-string p1, "Spray.java"

    const-string p2, "update navigation hud is called, but hud is null"

    .line 199
    invoke-static {p1, p2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    return-void
.end method
